package rpg.client.model;

import java.awt.Color;

import rpg.util.Objects;

public class Actor {
	public enum Gender {
		MALE, FEMALE;
	}
	
	public static class Builder {
		public Builder()  {
			super();
		}
		
		private String name = "";
		public Builder name(String s)  {
			name = s;
			return this;
		}
		
		public Actor build()  {
			return new Actor(this);
		}

		private Gender gender = Gender.MALE;
		public Builder gender(Gender g)  {
			gender = g;
			return this;
		}

		private Color hairColour = Color.BLACK;
		public Builder hairColour(Color c)  {
			hairColour = c;
			return this;
		}
		
		private String id = "";
		public Builder id(String s) {
			id = s;
			return this;
		}
	}
	
	private final String id;
	private final String name;
	private final Gender gender;
	private final Color hairColour;
	public Color getHairColour()  {
		return hairColour;
	}
	
	private Actor(Builder b)  {
		super();
		id = b.id;
		name = b.name;
		gender = Objects.requireNonNull(b.gender, "Actor.gender");
		hairColour = Objects.requireNonNull(b.hairColour, "Actor.hairColour");
	}

	public Gender getGender()  {
		return gender;
	}
	
	public String getId()  {
		return id;
	}
	
	public String getName()  {
		return name;
	}
	
	@Override
	public String toString()  {
		return "Actor: " + name;
	}
}
